import {reqGetGoodsList} from '@/api'
const state = {
  // 初始值
  goodsList:{}
};
const mutations = {
  GETDOODSLIAT(state,goodsList){
    state.goodsList = goodsList
  }
};
const actions = {
  async getGoodsList(context,params={}){
     let res = await reqGetGoodsList(params)
     if (res.code == 200){
       context.commit('GETDOODSLIAT',res.data)
     }
  }
};
const getters = {
  goodsList(state){
    return state.goodsList.goodsList||[]
  },
  attrsList(state){
    return state.goodsList.attrsList||[]
  },
  trademarkList(state){
    return state.goodsList.trademarkList||[]
  }
};
export default {
  state,
  mutations,
  actions,
  getters
}